import React from 'react'

import { Redirect } from 'react-router-dom'

const DDiscover = React.lazy(_ => import('@/pages/discover'))
const DRecommend = React.lazy(_ => import('@/pages/discover/c-pages/recommend'))
const DToplist = React.lazy(_ => import('@/pages/discover/c-pages/toplist'))
const DAlbum = React.lazy(_ => import('@/pages/discover/c-pages/album'))
const DArtist = React.lazy(_ => import('@/pages/discover/c-pages/artist'))
const DDjradio = React.lazy(_ => import('@/pages/discover/c-pages/djradio'))
const DPlaylist = React.lazy(_ => import('@/pages/discover/c-pages/playlist'))
const DPlayer = React.lazy(_ => import('@/pages/player'))

const DFriend = React.lazy(_ => import('@/pages/friend'))
const DMine = React.lazy(_ => import('@/pages/mine'))


// import DDiscover from '@/pages/discover'
// import DRecommend from '@/pages/discover/c-pages/recommend'
// import DToplist from '@/pages/discover/c-pages/toplist'
// import DAlbum from '@/pages/discover/c-pages/album'
// import DArtist from '@/pages/discover/c-pages/artist'
// import DDjradio from '@/pages/discover/c-pages/djradio'
// import DPlaylist from '@/pages/discover/c-pages/playlist'
// import DPlayer from "../pages/player"

// import DFriend from '@/pages/friend'
// import DMine from '@/pages/mine'


const routes = [
  {
    path: "/",
    exact: true,
    render: () => (
      <Redirect to="/discover" />
    )
  },
  {
    path: "/discover",
    component: DDiscover,
    routes: [
      {
        path: "/discover",
        exact: true,
        render: () => (
          <Redirect to="/discover/recommend"/>
        )
      },
      {
        path: "/discover/recommend",
        component: DRecommend,
      },
      {
        path: "/discover/toplist",
        component: DToplist
      },
      {
        path: "/discover/playlist",
        component: DPlaylist
      },
      {
        path: "/discover/djradio",
        component: DDjradio
      },
      {
        path: "/discover/artist",
        component: DArtist
      },
      {
        path: "/discover/album",
        component: DAlbum
      },
      {
        path: "/discover/player",
        component: DPlayer
      }
    ]
  },
  {
    path: "/mine",
    component: DMine
  },
  {
    path: "/friend",
    component: DFriend
  }
]

export default routes;